//Copyright 2012 Trevin Liberty
//GNU GPL v3
//Author: Trevin Liberty

#ifndef BARRACKS_H
#define BARRACKS_H

#include <allegro5\allegro.h>

#include "../Doohickey.h"
#include "../Entity.h"

class Barracks : public Doohickey {
private:
	static ALLEGRO_BITMAP** images;

	int unitBuildTimer;

	void loadImages();
	bool setEntityPos(Entity* e);

public:
	//Constructor
	//	PARAMS:
	//Map* map: SEE: Structs.h->struct Map{...}
	//Point<int> pos: Screen Position of the Barracks.
	Barracks(Map* map, Point<int> pos);

	//Draws the Barracks
	//	PARAMS:
	//Point<float> cameraPos: Used to offset images
	void draw(Point<float> cameraPos);

	//Updates the Barracks.
	//Here because of virtual functions of base class.
	//ATTN: Does nothing
	//TODO: fix this...
	void update() {};

	//Updates the Barracks.
	//Upon first call a timer is started. All subsequent calls will return false
	//	until the timer has passed a certain point.
	//Returns true if the timer for building the passed entity is up.
	//	PARAMS:
	//Entity* e: Continually pass the same Entity until function returns true.
	bool update(Entity* e);
};

#endif